package com.qqzone.qq.dao.impl;


import com.qqzone.myssm.basedao.BaseDAO;
import com.qqzone.qq.dao.UserBasicDao;
import com.qqzone.qq.pojo.UserBasic;

import java.util.List;

public class UserBasicDaoImpl extends BaseDAO<UserBasic> implements UserBasicDao {

    @Override
    public UserBasic getUserBasic(String loginId, String pwd) {
        return super.load("select * from t_user_basic where loginId = ? and pwd = ? ", loginId, pwd);
    }

    @Override
    public List<UserBasic> getUserBasicList(UserBasic userBasic) {
        return super.executeQuery("select fid as 'id' from t_friend where uid = ?", userBasic.getId()); //as 需要加单引号
    }

    @Override
    public UserBasic getUserBasicById(Integer id) {
        return super.load("select * from t_user_basic where id = ?", id);
    }
}
